package main

import (
	"go-reptile/crawler_distributed/rpcsupport"
	"go-reptile/crawler_distributed/persist"
	"gopkg.in/olivere/elastic.v5"
)

func main() {
	serveRpc(":1234", "dating_profile")
}

func serveRpc(host,index string) error{
	client, e := elastic.NewClient(
		elastic.SetURL("http://111.231.204.48:9200"),
		elastic.SetSniff(false),
	)
	if e != nil {
		return e
	}

	return rpcsupport.ServerRpc(host,&persist.ItemSaverService{
		Client:		client,
		Index:		index,
	})
}
